package com.cy.ppj.dao.mapper.product;

import com.cy.ppj.model.domian.product.ProductRate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

@Mapper
public interface ProductRateMapper extends BaseMapper<ProductRate> {

    void insertBatch(List<ProductRate> list);

    void deletaBatch(@Param("productId") Long productId, @Param("rateIds") List<Integer> periodsList);

    List<ProductRate> queryRateByProductId(@Param("productId") Long productId);
    
    ProductRate queryRateByProductIdAndPeriods(@Param("productId") Long productId, @Param("periods") Integer periods);
    
    List<Integer> queryPeriodsByOrderId(@Param("orderId") Long orderId);
}
